create procedure [dbo].procCUSTINFO_isUsed(
@CUSTID as nvarchar(12)
)
AS
BEGIN
SELECT     TOP (1) MAKH AS CUSTID
FROM         GIAODICH
WHERE     (MAKH = @CUSTID)
UNION ALL
SELECT     TOP (1) CUSINFO AS CUSTID
FROM         BAOCAOTHUE
WHERE     (CUSINFO = @CUSTID)
END